function getRamdomNum(name = '未知工种', base = 100) {
  let online = base;
  let offline = 0;
  // let online = Math.ceil(Math.random() * base);
  // let offline = base - online;
  return { name, online, offline };
}

const csvTable = [
  [ '检查人员', 215 ],
  [ '钢筋工', 62 ],
  [ '木工', 45 ],
  [ '保安', 15 ],
  [ '筑路工', 11 ],
  [ '安全员', 5 ],
  [ '建筑起重机械司机', 2 ],
  [ '监理员', 2 ],
  [ '司机', 2 ],
  [ '专业监理工程师', 2 ],
  [ '机械员', 1 ],
  [ '项目经理', 1 ],
  [ '技术负责人', 1 ],
  [ '劳务员', 1 ],
  [ '建筑电工', 1 ],
  [ '质量员', 1 ],
  [ '施工员', 1 ],
  [ '安全监理工程师', 1 ],
  [ '总监理工程师', 1 ],
  [ '建筑架子工', 1 ],
  [ '其他', 104 ],
];


let data = csvTable.slice(0,6).reduce(
  (r, e) => {
    const { name, online, offline } = getRamdomNum(e[0], e[1]);
    r[0].unshift(name);
    r[1].unshift(online);
    r[2].unshift(offline);
    return r;
  },
  [[], [], []],
);

export const restData =  csvTable.slice(7)

export default data;
